#!/bin/csh 

#foreach yy (2006 2007 2008 2009 2010 2011 )
foreach yy (2003 ) 

set ya = `expr $yy - 1` ; echo $ya
set yb = `expr $yy + 1` ; echo $yb

foreach tp (BC) 

   rm -f GFED3.1_daily_${tp}_${yy}.nc 
   rm -f GFED3.1_daily_${tp}_${yy}_2x2.5.nc 
 
   cdo mergetime daily_${tp}_${ya}1231.nc daily_${tp}_${yy}??.nc daily_${tp}_${yb}0101.nc GFED3.1_daily_${tp}_${yy}.nc 

   cdo remapcon,cam5_grid_144x96  GFED3.1_daily_${tp}_${yy}.nc  GFED3.1_daily_${tp}_${yy}_2x2.5.nc

end

end




